<div class="container" style="background-color: white;padding-top: 30px;padding-bottom: 20px">
	<form action="index.php/Suggestion/save" method="post" id="suggestform">
		<div class="input-group" style="margin-bottom: 15px">
			<span class="input-group-addon" id="basic-addon1">姓名</span>
			<input type="text" class="form-control" placeholder="姓名"
				   name="username" aria-describedby="basic-addon1">
		</div>
		<div class="input-group"  style="margin-bottom: 15px">
			<span class="input-group-addon" id="basic-addon2">手机</span>
			<input type="text" class="form-control" placeholder="手机"
				  name="mobile" aria-describedby="basic-addon2">
		</div>
		<div class="input-group"  style="margin-bottom: 15px">
			<span class="input-group-addon" id="basic-addon3">标题</span>
			<input type="text" class="form-control" placeholder="标题"
				   name="title" aria-describedby="basic-addon3">
		</div>
		<div  style="margin-bottom: 15px">
			<span>意见建议内容：</span>
		</div>
		<div style="height: 200px; margin-bottom: 25px;"><textarea name="content"  style="margin-bottom: 15px; height: 100%; width:100%;"></textarea></div>
		<div class="row">
			<div class="col-xs-6" style="text-align: center">
				<button id="clear" type="button">清空</button>
			</div>
			<div class="col-xs-6"  style="text-align: center">
				<button id="submitbtn" type="button">确定</button>
			</div>
		</div>
	</form>
</div>
<script>
	$("#clear").on('click',function(){
		$("input[name='username']").val("");
		$("input[name='title']").val("");
		$("input[name='mobile']").val("");
		$("input[name='content']").val("");
		return false;
	});

	$("#submitbtn").on('click',function(){
		var username=$("input[name='username']").val();
		var title=$("input[name='title']").val();
		var mobile=$("input[name='mobile']").val();
		var content=$("input[name='content']").val();
		if(username=='' || username.length<2 || title=='' ||title.length<2||mobile=='' ||
			mobile.length<10){
			alert("请检查输入的内容，参数不能为空，不能小于2个字符！");
			return false;
		}
		$("#suggestform").submit();;

	});

</script>